{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<style>\n",
       "@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');\n",
       "@import url('http://fonts.googleapis.com/css?family=Lora');\n",
       "\n",
       "//@import url('http://fonts.googleapis.com/css?family=Open+Sans');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Vollkorn');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Karla');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Poppins');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Arimo');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Roboto');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Lato');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Domine');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Chivo');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Cardo');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Arvo');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Crimson+Text');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Ubuntu');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Fontin');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Raleway');\n",
       "//@import url('http://fonts.googleapis.com/css?family=Merriweather');\n",
       "\n",
       "\n",
       ".CodeMirror pre {\n",
       "    font-family: 'Source Code Pro', Consolas, monocco, monospace;\n",
       "}\n",
       "    div.cell{\n",
       "        width: 850px;\n",
       "        margin-left: 0% !important;\n",
       "        margin-right: auto;\n",
       "    }\n",
       "    div.text_cell_render{\n",
       "        font-family: 'Lora';\n",
       "        //font-family: 'Open Sans';\n",
       "        //font-family: 'Karla',verdana,arial,sans-serif;\n",
       "        //font-family: 'Roboto',verdana,arial,sans-serif;\n",
       "        //font-family: 'Lato',verdana,arial,sans-serif;\n",
       "        //font-family: 'Domine',verdana,arial,sans-serif;\n",
       "        //font-family: 'Chivo',verdana,arial,sans-serif;\n",
       "        //font-family: 'Cardo',verdana,arial,sans-serif;\n",
       "        //font-family: 'Arvo',verdana,arial,sans-serif;\n",
       "        //font-family: 'Poppins',verdana,arial,sans-serif;   \n",
       "        //font-family: 'Ubuntu',verdana,arial,sans-serif;\n",
       "        //font-family: 'Fontin',verdana,arial,sans-serif;\n",
       "        //font-family: 'Raleway',verdana,arial,sans-serif;\n",
       "        //font-family: 'Merriweather',verdana,arial,sans-serif;\n",
       "        //font-family: 'Crimson Text', verdana,arial,sans-serif;\n",
       "        //font-family: verdana,arial,sans-serif;\n",
       "        //font-family: arial,sans-serif;\n",
       "        line-height: 125%;\n",
       "        font-size: 130%;\n",
       "        text-align: justify;\n",
       "        text-justify:inter-word;\n",
       "    }\n",
       "    div.text_cell code {\n",
       "        background: transparent;\n",
       "        color: #000000;\n",
       "        font-weight: 400;\n",
       "        font-size: 12pt;\n",
       "        //font-style: bold;\n",
       "        font-family:  'Source Code Pro', Consolas, monocco, monospace;\n",
       "   }\n",
       "    h1 {\n",
       "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "\t}\n",
       "\t\n",
       "    div.input_area {\n",
       "        background: #F6F6F9;\n",
       "        border: 1px solid #586e75;      \n",
       "    }\n",
       "\n",
       "    .text_cell_render h1 {\n",
       "        font-weight: 200;\n",
       "        font-size: 30pt;\n",
       "        line-height: 100%;\n",
       "        color:#c76c0c;\n",
       "        margin-bottom: 0.5em;\n",
       "        margin-top: 1em;\n",
       "        display: block;\n",
       "        white-space: wrap;\n",
       "        text-align: left;\n",
       "    } \n",
       "    h2 {\n",
       "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "        text-align: left;\n",
       "    }\n",
       "    .text_cell_render h2 {\n",
       "        font-weight: 200;\n",
       "        font-size: 16pt;\n",
       "        font-style: italic;\n",
       "        line-height: 100%;\n",
       "        color:#c76c0c;\n",
       "        margin-bottom: 0.5em;\n",
       "        margin-top: 1.5em;\n",
       "        display: block;\n",
       "        white-space: wrap;\n",
       "        text-align: left;\n",
       "    } \n",
       "    h3 {\n",
       "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "    }\n",
       "    .text_cell_render h3 {\n",
       "        font-weight: 200;\n",
       "        font-size: 14pt;\n",
       "        line-height: 100%;\n",
       "        color:#d77c0c;\n",
       "        margin-bottom: 0.5em;\n",
       "        margin-top: 2em;\n",
       "        display: block;\n",
       "        white-space: wrap;\n",
       "        text-align: left;\n",
       "    }\n",
       "    h4 {\n",
       "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "    }\n",
       "    .text_cell_render h4 {\n",
       "        font-weight: 100;\n",
       "        font-size: 14pt;\n",
       "        color:#d77c0c;\n",
       "        margin-bottom: 0.5em;\n",
       "        margin-top: 0.5em;\n",
       "        display: block;\n",
       "        white-space: nowrap;\n",
       "    }\n",
       "    h5 {\n",
       "        font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "    }\n",
       "\n",
       "    .text_cell_render h5 {\n",
       "        font-weight: 200;\n",
       "        font-style: normal;\n",
       "        color: #1d3b84;\n",
       "        font-size: 16pt;\n",
       "        margin-bottom: 0em;\n",
       "        margin-top: 0.5em;\n",
       "        display: block;\n",
       "        white-space: nowrap;\n",
       "    }\n",
       "    div.output_subarea.output_text.output_pyout {\n",
       "        overflow-x: auto;\n",
       "        overflow-y: scroll;\n",
       "        max-height: 50000px;\n",
       "    }\n",
       "    div.output_subarea.output_stream.output_stdout.output_text {\n",
       "        overflow-x: auto;\n",
       "        overflow-y: scroll;\n",
       "        max-height: 50000px;\n",
       "    }\n",
       "    div.output_wrapper{\n",
       "        margin-top:0.2em;\n",
       "        margin-bottom:0.2em;\n",
       "}\n",
       "\n",
       "    code{\n",
       "        font-size: 6pt;\n",
       "\n",
       "    }\n",
       "    .rendered_html code{\n",
       "    background-color: transparent;\n",
       "    }\n",
       "    ul{\n",
       "        margin: 2em;\n",
       "    }\n",
       "    ul li{\n",
       "        padding-left: 0.5em; \n",
       "        margin-bottom: 0.5em; \n",
       "        margin-top: 0.5em; \n",
       "    }\n",
       "    ul li li{\n",
       "        padding-left: 0.2em; \n",
       "        margin-bottom: 0.2em; \n",
       "        margin-top: 0.2em; \n",
       "    }\n",
       "    ol{\n",
       "        margin: 2em;\n",
       "    }\n",
       "    ol li{\n",
       "        padding-left: 0.5em; \n",
       "        margin-bottom: 0.5em; \n",
       "        margin-top: 0.5em; \n",
       "    }\n",
       "    ul li{\n",
       "        padding-left: 0.5em; \n",
       "        margin-bottom: 0.5em; \n",
       "        margin-top: 0.2em; \n",
       "    }\n",
       "    a:link{\n",
       "       font-weight: bold;\n",
       "       color:#447adb;\n",
       "    }\n",
       "    a:visited{\n",
       "       font-weight: bold;\n",
       "       color: #1d3b84;\n",
       "    }\n",
       "    a:hover{\n",
       "       font-weight: bold;\n",
       "       color: #1d3b84;\n",
       "    }\n",
       "    a:focus{\n",
       "       font-weight: bold;\n",
       "       color:#447adb;\n",
       "    }\n",
       "    a:active{\n",
       "       font-weight: bold;\n",
       "       color:#447adb;\n",
       "    }\n",
       "    .rendered_html :link {\n",
       "       text-decoration: underline; \n",
       "    }\n",
       "    .rendered_html :hover {\n",
       "       text-decoration: none; \n",
       "    }\n",
       "    .rendered_html :visited {\n",
       "      text-decoration: none;\n",
       "    }\n",
       "    .rendered_html :focus {\n",
       "      text-decoration: none;\n",
       "    }\n",
       "    .rendered_html :active {\n",
       "      text-decoration: none;\n",
       "    }\n",
       "    .warning{\n",
       "        color: rgb( 240, 20, 20 )\n",
       "    } \n",
       "    hr {\n",
       "      color: #f3f3f3;\n",
       "      background-color: #f3f3f3;\n",
       "      height: 1px;\n",
       "    }\n",
       "    blockquote{\n",
       "      display:block;\n",
       "      background: #fcfcfc;\n",
       "      border-left: 5px solid #c76c0c;\n",
       "      font-family: 'Open sans',verdana,arial,sans-serif;\n",
       "      width:680px;\n",
       "      padding: 10px 10px 10px 10px;\n",
       "      text-align:justify;\n",
       "      text-justify:inter-word;\n",
       "      }\n",
       "      blockquote p {\n",
       "        margin-bottom: 0;\n",
       "        line-height: 125%;\n",
       "        font-size: 100%;\n",
       "      }\n",
       "</style>\n",
       "<script>\n",
       "    MathJax.Hub.Config({\n",
       "                        TeX: {\n",
       "                           extensions: [\"AMSmath.js\"],\n",
       "                           equationNumbers: { autoNumber: \"AMS\", useLabelIds: true}\n",
       "                           },\n",
       "                tex2jax: {\n",
       "                    inlineMath: [ ['$','$'], [\"\\\\(\",\"\\\\)\"] ],\n",
       "                    displayMath: [ ['$$','$$'], [\"\\\\[\",\"\\\\]\"] ]\n",
       "                },\n",
       "                displayAlign: 'center', // Change this to 'center' to center equations.\n",
       "                \"HTML-CSS\": {\n",
       "                    scale:95,\n",
       "                        availableFonts: [],\n",
       "                        preferredFont:null,\n",
       "                        webFont: \"TeX\",\n",
       "                    styles: {'.MathJax_Display': {\"margin\": 4}}\n",
       "                }\n",
       "        });\n",
       "</script>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#format the book\n",
    "%matplotlib inline\n",
    "from __future__ import division, print_function\n",
    "import sys;sys.path.insert(0,'..')\n",
    "from  book_format import load_style;load_style('..')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Interactions\n",
    "\n",
    "This is a collection of interactions, mostly from the book. If you have are reading a print version of the book, or are reading it online via Github or nbviewer you will be unable to run the interactions.\n",
    "\n",
    "So I have created this notebook. Here is how you run an interaction if you do not have IPython installed on your computer.\n",
    "\n",
    "1. Go to try.juptyer.org in your browser. It will launch a temporary notebook server for you.\n",
    "\n",
    "2. Click the **New** button and select `Python 3`. This will create a new notebook that will run Python 3 for you in your browser.\n",
    "\n",
    "3. Copy the entire contents of a cell from this notebook and paste it into a 'code' cell in the notebook on your browser. \n",
    "\n",
    "4. Press CTRL+ENTER to execute the cell.\n",
    "\n",
    "5. Have fun! Change code. Play. Experiment. Hack.\n",
    "\n",
    "Your server and notebook is not permanently saved. Once you close the session your data is lost. Yes, it says it is saving your file if you press save, and you can see it in the directory. But that is just happening in a Docker container that will be deleted as soon as you close the window. Copy and paste any changes you want to keep to an external file.\n",
    "\n",
    "Of course if you have IPython installed you can download this notebook and run it on your own computer. Type\n",
    "\n",
    "    ipython notebook\n",
    "    \n",
    "in a command prompt from the directory where you downloaded this file. Click on the name of this file to open it."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Experimenting with FPF'\n",
    "\n",
    "\n",
    "The Kalman filter uses the equation $P^- = FPF^\\mathsf{T}$ to compute the prior of the covariance matrix during the prediction step, where P is the covariance matrix and F is the system transistion function. For a Newtonian system $x = \\dot{x}\\Delta t + x_0$ F might look like\n",
    "\n",
    "$$F = \\begin{bmatrix}1 & \\Delta t\\\\0 & 1\\end{bmatrix}$$\n",
    "\n",
    "$FPF^\\mathsf{T}$ alters P by taking the correlation between the position ($x$) and velocity ($\\dot{x}$). This interactive plot lets you see the effect of different designs of F has on this value. For example,\n",
    "\n",
    "* what if $x$ is not correlated to $\\dot{x}$? (set F01 to 0)\n",
    "\n",
    "* what if $x = 2\\dot{x}\\Delta t + x_0$? (set F01 to 2)\n",
    "\n",
    "*  what if $x = \\dot{x}\\Delta t + 2*x_0$? (set F00 to 2)\n",
    "\n",
    "* what if $x = \\dot{x}\\Delta t$?  (set F00 to 0)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "collapsed": false,
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAARUAAAEtCAYAAAAmx/QiAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8FVXex/HPL4XQQZDeBAQRUJYiIoiICCKiqKCsFAX3\ngbXsioqirG3lcX2URV3RRV1XXUWQFhdFepRiQRApEgTp0kOVIFJC8nv+OBO4hCTkJnNzb5Lf+/Wa\nV27mzp1zEu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aKsYYX1momMxY89Xkml3+GGN8ZS0VY4yvLFSM\nMb6yUDHG+MpCxRjjKwsVY4yv/h9mP9auwvP5bQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x74132e8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "from IPython.html.widgets import interact, interactive, fixed\n",
    "import IPython.html.widgets as widgets\n",
    "import numpy as np\n",
    "import numpy.linalg as linalg\n",
    "import math\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib.patches import Ellipse\n",
    "\n",
    "def plot_covariance_ellipse(x, P, edgecolor='k'):\n",
    "    U,s,v = linalg.svd(P)\n",
    "    angle = math.atan2(U[1,0],U[0,0])\n",
    "    width  = math.sqrt(s[0]) * 2\n",
    "    height = math.sqrt(s[1]) * 2\n",
    "\n",
    "    ax = plt.gca()\n",
    "    e = Ellipse(xy=(0, 0), width=width, height=height, angle=angle,\n",
    "                edgecolor=edgecolor, facecolor='none',\n",
    "                lw=2, ls='solid')\n",
    "    ax.add_patch(e)\n",
    "    ax.set_aspect('equal')\n",
    "    \n",
    "    \n",
    "def plot_FPFT(F00, F01, F10, F11, covar):\n",
    "    \n",
    "    dt = 1.\n",
    "    x = np.array((0, 0.))\n",
    "    P = np.array(((1, covar), (covar, 2)))\n",
    "    F = np.array(((F00, F01), (F10, F11)))\n",
    "\n",
    "    plot_covariance_ellipse(x, P)\n",
    "    plot_covariance_ellipse(x, np.dot(F, P).dot(F.T), edgecolor='r')\n",
    "    #plt.axis('equal')\n",
    "    plt.xlim(-4, 4)\n",
    "    plt.ylim(-4, 4)\n",
    "    plt.title(str(F))\n",
    "    plt.xlabel('position')\n",
    "    plt.ylabel('velocity')\n",
    "                 \n",
    "interact(plot_FPFT, \n",
    "         F00=widgets.IntSlider(value=1, min=0, max=2.), \n",
    "         F01=widgets.FloatSlider(value=1, min=0., max=2., description='F01(dt)'),\n",
    "         F10=widgets.FloatSlider(value=0, min=0., max=2.),\n",
    "         F11=widgets.FloatSlider(value=1, min=0., max=2.),\n",
    "         covar=widgets.FloatSlider(value=0, min=0, max=1.));"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Covariance Ellipse\n",
    "\n",
    "See the effect of varying the variances and covariance of a covariance matrix of the form\n",
    "\n",
    "$$\\begin{bmatrix}\\texttt{var}_x & \\texttt{cov}_xy \\\\ \\texttt{cov}_xy & \\texttt{var}_y\\end{bmatrix}$$"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAQMAAAEACAYAAAC3RRNlAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAGwpJREFUeJzt3Xl0VeW9//H3NwPKYAISB0gwDIKiGBOMVAR6hSh47U8u\nii7BSAtaZxS9FCsI6vKn1WJd3CJeS22xWgK0QlH6a4GAUaxSNAGiDNEyiAxBRMRDQAwZnt8f2YnR\nQgiezdnnhM9rrax1hs2zP+skfPLsk+fsbc45RETigg4gItFBZSAigMpARDwqAxEBVAYi4lEZiAjg\nUxmYWbKZvWJmJWa2zsx+4Me4IhI5CT6N82vg7865680sAWjh07giEiEW7qIjM0sCVjvnuvgTSUSC\n4MdhQifgczN70cxWmdlvzay5D+OKSAT5MTO4CFgB9HbOFZnZ/wAh59wjtduEQiGteRYJWHJysjX0\nvB8zg+3ANudckXd/LtDTh3FFJILCLgPn3C5gm5l18x7KAdaHO66IRJZff024F8gzs0RgMzDqSBsm\nJyf7tMvwFBXVTGSys7MDTvKNaMwE0ZlLmRonFAo1eltfysA59z5wsR9jiUgwtAJRRACVgYh4VAYi\nAqgMRMSjMhARQGUgIh6VgYgAKgMR8agMRARQGYiIR2UgIoDKQEQ8KgMRAVQGIuJRGYgIoDIQEY/K\nQEQAlYGIeFQGIgKoDETEozIQEUBlICIelYGIACoD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wxXCq//4Q5hpv785c+awfft2unfvTt++\nfQPLEWtUBhHUqlUrfv7zmtM9PPzwwxG96s/xKoJa9QvhrNPP5oYBd/oy7rFyztVdoGbcuHHExelH\nvLH0SkXYnXfeSbt27Vi5ciXPP/98RPZ5vIug1gWde3HnkIe565pHaXFyK1/Hbqy5c+eydu1a2rdv\nT25ubiAZYpXKIMJatGhRdz7/Bx54gM2bNx/X/UWqCGp165ARWBHs27eP++67D4CJEyfSrFmzQHLE\nKpVBAK699lpuuOEGvvrqK26++WaqqqqOy36+LItsEQRt0qRJlJaW0qtXL2677bag48QclUFApk2b\nxumnn86yZcsYP378cdlHy+bQpeYzUk2+CJYtW8a0adOIj49n+vTpxMfHBx0p5ujkJgFJSUlhzpw5\nDBw4kKeffpru3bv7fvbkxAQj71FHnMHAHzTdIti+fTvXX3891dXVjB8/Xpev+540MwhQ//79694/\nuP3221m5cqXv+0hMMGY/1nSLoLy8nKFDh7J7924uv/xyHnvssaAjxSyVQcBuv/12xowZQ0VFBffd\ndx+FhYW+76OprsCrrKwkNzeX9957j/T0dGbPnk1Cgia735fKIAo888wzjBw5kq+//pr777+fxYsX\nBx0p6lVWVjJp0iTmzZtHcnIyr776KikpKUHHimkqgygQHx/P73//e6655hrKy8sZPHiwrhHYgEOH\nDvHII4+wdOlSkpKSyM/P1/sEPlAZRIm4uDjGjx/PDTfcwKFDhxg2bBiTJk06bn92jFWff/45AwcO\nJD8/n5YtW7J48WJ69TrimfnlGKgMooiZMXbsWKZMmUJcXByPP/44AwcOjIkTqUbC2rVr6dWrF8uW\nLSMlJYXnnnuu7nqKEj6VQZQxM+677z7y8/M5/fTTKSgoIDMzk4KCgqCjBcY5x4svvkjv3r35+OOP\nyc7O5qWXXtK1K32mMohSOTk5FBcX079/f3bt2sXll1/OyJEj2bp1a9DRImr79u0MGTKEm2++mf37\n93PjjTfy1ltvcfrppwcdrclRGUSxdu3asWTJEh555BESEhJ46aWX6NatG+PGjas7DXhTVVVVxbPP\nPst5553HggUL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Nt\nqEVHIgLotGci4lEZiAigMhARj8pARACVgYh4VAYiAqgMRMSjMhARAP4/RD9Zo5ChyJwAAAAASUVO\nRK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x8005f60>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "from IPython.html.widgets import interact, interactive, fixed\n",
    "from IPython.html.widgets import FloatSlider\n",
    "from math import cos, sin, pi, atan2, sqrt\n",
    "import  numpy.linalg as linalg\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib.patches import Ellipse\n",
    "\n",
    "def plot_covariance_ellipse(P):\n",
    "    U,s,v = linalg.svd(P)\n",
    "    angle = atan2(U[1,0],U[0,0])\n",
    "    width  = sqrt(s[0]) * 2\n",
    "    height = sqrt(s[1]) * 2\n",
    "\n",
    "    ax = plt.gca()\n",
    "    e = Ellipse(xy=(0, 0), width=width, height=height, angle=angle,\n",
    "                edgecolor='k', facecolor='none',\n",
    "                lw=2, ls='solid')\n",
    "    ax.add_patch(e)\n",
    "    h, w = height/4, width/4\n",
    "    plt.plot([0, h*cos(angle+pi/2)], [0, h*sin(angle+pi/2)])\n",
    "    plt.plot([0, w*cos(angle)],      [0, w*sin(angle)])\n",
    "\n",
    "def plot_covariance(var_x, var_y, cov_xy):\n",
    "    P = [[var_x, cov_xy], [cov_xy, var_y]]\n",
    "    plot_covariance_ellipse(P)\n",
    "    plt.xlim(-6, 6)\n",
    "    plt.gca().set_aspect('equal')\n",
    "    plt.ylim(-6, 6)\n",
    "    plt.show()\n",
    "\n",
    "interact (plot_covariance,           \n",
    "          var_x=FloatSlider(value=5., min=0, max=20.), \n",
    "          var_y=FloatSlider(value=5., min=0., max=20.), \n",
    "          cov_xy=FloatSlider(value=1.5, min=0.0, max=50, step=.2));\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# g-h Filter\n",
    "\n",
    "Experiment with various values for g-h filter parameters."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": false
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAa8AAAEACAYAAAAEIfk6AAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzsnXd4lMX2xz+TQggthE7o0nsVRQS9IigWsDf0YkNs197Q\n67Vdf3YBsVyxYy+gYKGIKIggCNKkt9AJPUAgfX5/zL77zrvZTTbJhpB4Ps+TJzPzlp19Cfvdc+bM\nOUprjSAIgiCUJaJKewKCIAiCUFhEvARBEIQyh4iXIAiCUOYQ8RIEQRDKHCJegiAIQplDxEsQBEEo\nc0REvJRSCUqpL5VSK5VSy5VSJymlEpVS05RSq5VSU5VSCdb5I5RSa33nD4jEHARBEIS/D5GyvEYD\nP2it2wKdgVXAQ8B0rXVrYAYwAkAp1Q64DGgLDAReV0qpCM1DEARB+BtQbPFSSlUD+mit3wPQWmdr\nrVOBwcAHvtM+AC7wtQcBn/nOSwbWAj2LOw9BEATh70MkLK9mwB6l1HtKqT+VUmOVUpWAulrrFACt\n9U6gju/8BsAW6/ptvjFBEARBCIuYCN2jG3Cb1nqBUmokxmUYmHeqUHmoUlNTJW+VIAhCOSchIaFI\ny0aRsLy2Alu01gt8/fEYMUtRStUFUErVA3b5jm8DGlnXN/SNCYIgCEJYFFu8fK7BLUqpVr6hfsBy\nYBJwrW9sKDDR154EXKGUqqCUaga0AOYXdx6CIAjC34dIuA0B7gA+VkrFAhuA64Bo4Aul1PXAJkyE\nIVrrFUqpL4AVQBZwqy4gtX1CQkJ+h//2LFhgjN4ePXqU8kyOf+RZhY88q/CRZ1U4UlNTi32PiIiX\n1noJcGKQQ2eGOP8Z4JlIvLYgCIJwHHPOObBhA9SvD6+9Bu3aReS2kbK8BEEQBCEva9bA+vWwejVE\nRS6pk6SHEgRBEEoGrWH7dreflBSxW4t4CYIgCCVDaiocPWralStD1aoRu7WIlyAIglAyBFp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WZmuePkZWZmuePkZWZmufM/F1GgH2P+rbwA\nAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x80526d8>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "from IPython.html.widgets import interact, interactive, fixed\n",
    "import IPython.html.widgets as widgets\n",
    "import matplotlib.pyplot as plt\n",
    "import numpy as np\n",
    "import numpy.random as random\n",
    "\n",
    "def gen_data(x0, dx, count, noise_factor):\n",
    "    return [x0 + dx*i + random.randn()*noise_factor for i in range (count)]\n",
    "\n",
    "def g_h_filter(data, x0, dx, g, h, dt=1., pred=None):    \n",
    "    x = x0\n",
    "    results = []\n",
    "    for z in data:\n",
    "        #prediction step\n",
    "        x_est = x + (dx*dt)\n",
    "        dx = dx        \n",
    "        if pred is not None:\n",
    "            pred.append(x_est)\n",
    "        \n",
    "        # update step\n",
    "        residual = z - x_est\n",
    "        dx = dx    + h * (residual) / dt\n",
    "        x  = x_est + g * residual     \n",
    "        results.append(x)  \n",
    "    return np.array(results)\n",
    "\n",
    "zs = gen_data(x0=5, dx=5, count=100, noise_factor=50)\n",
    "\n",
    "def interactive_gh(x, dx, g, h):\n",
    "    data = g_h_filter(data=zs, x0=x, dx=dx, dt=1.,g=g, h=h)\n",
    "    plt.plot(zs, color='r')\n",
    "    plt.plot(data, color='k')\n",
    "    plt.show()\n",
    "\n",
    "interact (interactive_gh,           \n",
    "          x=widgets.FloatSlider(value=0., min=-50, max=50.), \n",
    "          dx=widgets.FloatSlider(value=5., min=-50., max=50.), \n",
    "          g=widgets.FloatSlider(value=0.1, min=0.01, max=2, step=.02), \n",
    "          h=widgets.FloatSlider(value=0.02, min=0.0, max=0.5, step=0.01));"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
